This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from moviepy.editor import VideoClip, TextClip | |
from tqdm import tqdm | |
def make_frame(t): | |
# Calculate remaining time in minutes and seconds | |
remaining_time = max(0, int(5*60 - t)) | |
minutes, seconds = divmod(remaining_time, 60) | |
time_str = f"{minutes:01d}:{seconds:02d}" | |
# Create TextClip for the countdown with 4K resolution |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import openai | |
openai.api_key = 'sk-API 키를 입력하세요' | |
def lambda_handler(event, context): | |
if 'm' in event['params']['querystring']: | |
input_message = event['params']['querystring']['m'] | |
else: | |
input_message = "나는 신한투자증권에 입사하려는 개발자야. 클라우드를 공부해야 할 필요가 있을까?" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import openai | |
openai.api_key = 'sk-API키를 입력합니다' | |
def lambda_handler(event, context): | |
message = openai.ChatCompletion.create( | |
model="gpt-4o-mini", # 사용 모델 | |
messages=[ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fastapi import FastAPI | |
import redis | |
app = FastAPI() | |
redis_client = redis.Redis(host='localhost', port=6379, db=0) | |
@app.get("/items/{id}") | |
def read_item(id: str): | |
value = redis_client.get(id) | |
if value: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from moviepy.editor import TextClip, CompositeVideoClip, ColorClip | |
from moviepy.editor import VideoFileClip, concatenate_videoclips | |
from moviepy.video.fx.all import fadein, fadeout | |
from multiprocessing import Pool | |
import os | |
# 시간을 HH:MM:SS 형식으로 변환하는 함수 | |
def format_time(seconds): | |
hours = seconds // 3600 | |
minutes = (seconds % 3600) // 60 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from moviepy.editor import TextClip, CompositeVideoClip, ColorClip | |
from moviepy.video.fx.all import fadein, fadeout | |
# 60초 카운트다운 비디오 생성 (메모리 최적화) | |
def create_stylish_countdown_video(duration=60): | |
# 비디오 파일의 파트들을 저장할 리스트 | |
filenames = [] | |
for i in range(duration, 0, -1): | |
# 배경 클립 생성 (파란색 배경) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### steps #### | |
# verify the system has a cuda-capable gpu | |
# download and install the nvidia cuda toolkit and cudnn | |
# setup environmental variables | |
# verify the installation | |
### | |
### to verify your gpu is cuda enable check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from diffusers import LCMScheduler | |
from diffusers import AutoPipelineForText2Image | |
import torch | |
from dotenv import load_dotenv | |
import os | |
from openai import OpenAI | |
import gradio as gr | |
import random | |
import time | |
import string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from broadcaster import Broadcast | |
from starlette.applications import Starlette | |
from starlette.concurrency import run_until_first_complete | |
from starlette.routing import Route, WebSocketRoute | |
from starlette.templating import Jinja2Templates | |
from starlette.middleware import Middleware | |
from starlette.middleware.cors import CORSMiddleware | |
from dotenv import load_dotenv | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I want you to help me make requests (prompts) for the Stable Diffusion neural network. | |
Stable diffusion is a text-based image generation model that can create diverse and high-quality images based on your requests. In order to get the best results from Stable diffusion, you need to follow some guidelines when composing prompts. | |
Here are some tips for writing prompts for Stable diffusion1: | |
1) Be as specific as possible in your requests. Stable diffusion handles concrete prompts better than abstract or ambiguous ones. For example, instead of “portrait of a woman” it is better to write “portrait of a woman with brown eyes and red hair in Renaissance style”. | |
2) Specify specific art styles or materials. If you want to get an image in a certain style or with a certain texture, then specify this in your request. For example, instead of “landscape” it is better to write “watercolor landscape with mountains and lake". | |
3) Specify specific artists for reference. If you want to get an image similar to the work of some |
NewerOlder