Python code by request HTTP
There is a web application on the make.com platform.
There is a piece of code in Python - below - which generates images according to the introduced text.
You need: from a web application to send the text to the python code by which it generates the image, and the image to send back to the web application.
The web application supports http requests (http requests). If I understand correctly, the Python code can be stored on the site.
Part of Python code:
pip install "git+https://github.com/ai-forever/Kandinsky-2.0.git"
from kandinsky2 import get_kandinsky2
model = get_kandinsky2('cuda', task_type='text2img')
ages = model.generate_text2img('cat in space', batch_size=4, h=512, w=512, num_steps=75, denoised_type='dynamic_threshold', dynamic_threshold_v=99.5, sampler='ddim_sampler', free_eta=0.01, guidance_scale=10)
ChatGPT выдал что-то такое:
import requests
import json
from flask import Flask, request
from kandinsky2 import get_kandinsky2
app = Flask(__name__)
model = get_kandinsky2('cuda', task_type='text2img')
@app.route('/generate-image', methods=['POST'])
def generate_image():
# Get the JSON payload from the incoming request
request_data = request.get_json()
# Get the value of the 'text' key from the JSON payload
text_input = request_data['text']
# Generate an image using the text string
ages = model.generate_text2img(text_input, batch_size=4, h=512, w=512, num_steps=75, denoised_type='dynamic_threshold', dynamic_threshold_v=99.5, sampler='ddim_sampler', ddim_eta=0.01, guidance_scale=10)
# Convert the image to a JSON string and send it to the sender of the original request
result = json.dumps(ages)
payload = {'result': result}
headers = {'Content-Type': 'application/json'}
# Use the 'referer' header to get the URL of the sender of the original request
referer = request.headers.get('referer')
# Send the JSON payload to the sender of the original request using an HTTP POST request
response = requests.post(referer, json=payload, headers=headers)
return response.content, response.status_code
if __name__ == '__main__':
app.run()
-
428 5 0 I have a almost finished solution that is exactly what you want to get in the end ,, write I will do quickly and quality ,, since the system releases base64 ,, I think the best way will be to transfer from the python script to the site through the socket image ,, and deny it on the site
Current freelance projects in the category Python
Find a product feed (Google Merchant XML) for a website on OpenCart
16 USD
It is necessary to find a direct link to the active product feed (XML) of a competitor for Google Merchant Center Platform (CMS): OpenCart / ocStore Find the original feedRequirements for the result: Working link to the XML file Python, Data Parsing ∙ 3 hours 43 minutes back ∙ 17 proposals |
Development of a TikTok farm (content factory)It is necessary to develop a system for centralized management of multiple TikTok accounts with automatic content publishing, using individual proxies and simulating natural account activity. Functional Requirements1. Account Management Adding and removing TikTok accounts.… Python, Bot Development ∙ 15 hours 9 minutes back ∙ 12 proposals |
Improve the performance of Claude Code and work on software development.I am currently developing CRM and Analytics software. I am using Claude Code, but I understand that the results are not the best in terms of changes. There are 2 tasks - Need help creating a preset for skills, MD, and so on to improve quality. Take verified ones that have been… AI & Machine Learning, Python ∙ 21 hours 44 minutes back ∙ 21 proposals |
OCR systemA system for recognizing text on postal envelopes (index for whom - only numbers). The text can sometimes be handwritten. Recognition of stamps (counting quantity and denomination) Python ∙ 1 day back ∙ 20 proposals |
Looking for a white-label solution for a betting company for rent. |